import math
import sys
import io
import FileIO
import Probability
import Post
import Parser

ORIGINAL_FILE_PATH = "F:\Users\Seph\Datasets\StackOverflowCompetition\\testingWithCloseData.csv"
NEW_FILE_PATH = "F:\Users\Seph\Datasets\StackOverflowCompetition\\testingWithHeaderWithCloseData.csv"

INCLUDE_CLOSE_DATE = True
INCLUDE_CLOSE_REASON = True

def generateHeader():
	header = "PostId,PostCreationDate,OwnerUserId,OwnerCreationDate,ReputationAtPostCreation,OwnerUndeletedAnswerCountAtPostTime,Title,BodyMarkdown,Tag1,Tag2,Tag3,Tag4,Tag5"
	if(INCLUDE_CLOSE_DATE):
		header += ",PostClosedDate"
	if(INCLUDE_CLOSE_REASON):
		header += ",OpenStatus"
	header += "\n"
	return header

def main():
	originalFileStream = FileIO.openFile(ORIGINAL_FILE_PATH, FileIO.READ_MODE)
	newFileStream = FileIO.openFile(NEW_FILE_PATH, FileIO.WRITE_MODE)
	
	newFileStream.write(generateHeader())
	newFileStream.write(originalFileStream.read())	
if __name__=="__main__":
    main()